//
//  TTComposeTextView.swift
//  TTWeibo
//
//  Created by 陶宏路 on 16/7/26.
//  Copyright © 2016年 陶路路. All rights reserved.
//

import UIKit

class TTComposeTextView: UITextView {

    override init(frame: CGRect, textContainer: NSTextContainer?) {
        
        super.init(frame: frame, textContainer: textContainer)
        setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUpUI(){
        
//        backgroundColor = RandomColor()
        addSubview(composeText)
        
        composeText.snp_makeConstraints { (make) -> Void in
            
            make.top.equalTo(self).offset(8)
            make.leading.equalTo(self).offset(5)
            make.width.equalTo(self).offset(-10)
        }
    }
    
    func hiddenText(BOOL:Bool){
        
        if BOOL {
            
            composeText.hidden = true
            
        }else{
            
            composeText.hidden = false
        }
    }
    
    lazy var composeText:UILabel = {
        
        let compose = UILabel()
        compose.text = "你好:\(name),请输入文字吧"
        compose.numberOfLines = 0
        compose.font = UIFont.systemFontOfSize(15)
        compose.textColor = UIColor.grayColor()
        return compose
    }()
}
